Home:ALL Converter>Error when using Google Maps "Failed resolution of: Lcom/google/android/gms/R$layout;"

Error when using Google Maps "Failed resolution of: Lcom/google/android/gms/R$layout;"

Ask Time:2022-07-20T14:21:02         Author:김민주

Json Formatter

I put Google Maps on the fragment. However, the above error appears when running. "java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$layout;"

I'm uploading the code because it seems to be a layout problem.

fragment_map.xml

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MapnulliFragment">

    <com.google.android.gms.maps.MapView
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.google.android.gms.maps.MapFragment"
        />

    <androidx.cardview.widget.CardView
        android:name="@+id/card_view"
        android:layout_width="400dp"
        android:layout_height="40dp"
        android:layout_gravity="center"
        card_view:cardCornerRadius="4dp">

        <fragment
            android:id="@+id/place_autocomplete_fragment"
            android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"></fragment>
    </androidx.cardview.widget.CardView>
</RelativeLayout>

Author:김민주,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73046799/error-when-using-google-maps-failed-resolution-of-lcom-google-android-gms-rla
yy